package com.example.demo.mapper;

import com.example.demo.entity.TrafCross;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * ss
 *
 * @author ws
 * @since 2023-08-25
 */
@Mapper
public interface TrafCrossMapper {
    @Select("SELECT * FROM traf_cross")
    @Results({
            @Result(property = "cross_no",column = "crossNo"),
            @Result(property = "name",column = "name"),
            @Result(property = "cross_id",column = "crossId"),
            @Result(property = "longitute",column = "longitute"),
            @Result(property = "latitute",column = "latitute")
    })
    List<TrafCross> getAllTrafCrosss();


    /**
     * 根据id查询路口信息
     */
    TrafCross getTrafCrossById(Long crossNo);
}
